package TP1;

import java.util.Vector;

public class StatsIndex {
	public Vector<Integer> nbReponseList = new Vector<Integer>();
	public Vector<Integer> pBonneReponseList = new Vector<Integer>();
	public Vector<Integer> MauvaiseReponseList = new Vector<Integer>();
	public Vector<Integer> spamList = new Vector<Integer>();
	public Vector<Integer> pSpamList = new Vector<Integer>();
	public Vector<Integer> erreurSList = new Vector<Integer>();
	public Vector<Integer> hamList = new Vector<Integer>();
	public Vector<Integer> pHamList = new Vector<Integer>();
	public Vector<Integer> erreurHList = new Vector<Integer>();

	public void add(int nbReponse, int pBonneReponse, int MauvaiseReponse,
			int spam, int pSpam, int erreurS, int ham, int pHam, int erreurH) {
		nbReponseList.add(nbReponse);
		pBonneReponseList.add(pBonneReponse);
		MauvaiseReponseList.add(MauvaiseReponse);
		spamList.add(spam);
		pSpamList.add(pSpam);
		erreurSList.add(erreurS);
		hamList.add(ham);
		pHamList.add(pHam);
		erreurHList.add(erreurH);
	}

	public void AfficheMoyenne() {
		int nbReponse = 0;
		int pBonneReponse = 0;
		int MauvaiseReponse = 0;
		int spam = 0;
		int pSpam = 0;
		int erreurS = 0;
		int ham = 0;
		int pHam = 0;
		int erreurH = 0;

		int nbStat = nbReponseList.size();
		for (int i = 0; i < nbStat; i++) {
			nbReponse += nbReponseList.get(i);
			pBonneReponse += pBonneReponseList.get(i);
			MauvaiseReponse += MauvaiseReponseList.get(i);
			spam += spamList.get(i);
			pSpam += pSpamList.get(i);
			erreurS += erreurSList.get(i);
			ham += hamList.get(i);
			pHam += pHamList.get(i);
			erreurH += erreurHList.get(i);
		}
		pBonneReponse /= nbStat;
		pSpam /= nbStat;
		pHam /= nbStat;

		System.out.println("Stat moyenne :");
		System.out.println("" + nbReponse + " r�ponses : "
				+ (pBonneReponse / 100.f) + "%bonne " + MauvaiseReponse
				+ "mauvaise r�ponses");
		System.out.println("" + spam + " spam : " + (pSpam / 100.f)
				+ "%erreurSpam " + erreurS + "erreur spam");
		System.out.println("" + ham + " ham : " + (pHam / 100.f)
				+ "%erreurHam " + erreurH + "erreur Ham");
	}

}
